<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link href="${initParam.url }/statics/css/community.css"
	rel="stylesheet">
<script type="text/javascript">
	function queryCommunity() {
		$('#my').modal();

	};

	$(function() {
		$(".file").change(function() {
			$(".img").attr("src", URL.createObjectURL($(this)[0].files[0]))
		})
	})

	/**
	 $.ajax({
	 type:"post",
	 url:"",
	 dateType:"josn",
	 success:function(date){
	 $("#log").append("<from ><table><tr><td>安保处电话：</td><td></td></tr>"+
	 "<tr><td>物管处电话：</td><td></td></tr>"+
	 "<tr><td>小区LOGO：</td><td><input type='file' id='file' ></td></tr>"+
	 "</table> </from>");
	 $("#my").append("<button type='button' id='btn'>提交</button>");
	 },
	 errer:function(date){
	 alert("失败");
	 }
	 })
	 */

	/**
	
	$("#btn").click(function () {
	    $.ajaxFileUpload({
	        url: '/main/files',
	        fileElementId:'file',
	        dataType:'txt',
	        secureuri : false,
	        success: function (data){
	            if(data=="yes"){
	                $("#img-alert").css("display","block");
	            }
	        },
	        error:function(data,status,e){
	            alert(e);
	        }
	    })
	});
	 */
</script>
</head>
<body>
	<div
		style="width: 1080px; height: 640px; background-color: #FFF; margin: 20px;">
		<h4
			style="background-color: #9FB2C2; padding-left: 10px; color: #516D8A; line-height: 40px;">
			<img alt="" src="${initParam.url}/statics/images/title.jpg">
			小区信息
		</h4>
		<div class="com">
			<div class="com-1">
				<c:if test='${community.communityImg!=null and community.communityImg!="" }'>
				<a href="${initParam.url}/statics${community.communityImg }"> <img
					style="width: 230px; height: 230px; margin: 10px;"
					onerror="${initParam.url}/statics/images/暂无图片.jpg"
					src="${initParam.url}/statics${community.communityImg }">
				</a>
				</c:if>
				<c:if test='${community.communityImg==null or community.communityImg=="" }'>
				<a href="${initParam.url}/statics/images/暂无图片.jpg"> <img
					style="width: 230px; height: 230px; margin: 10px;"
					onerror="${initParam.url}/statics/images/暂无图片.jpg"
					src="${initParam.url}/statics/images/暂无图片.jpg">
				</a>
				</c:if>
			</div>


			<div class="com-2">
				<h3>${community.communityName}</h3>
				<table id="tai-1">
					<tr>
						<td>小区地址：</td>
						<td>${prov.province}&nbsp;${city.city}&nbsp;${dist.district}&nbsp;${community.communityName}</td>
					</tr>
					<tr>
						<td>保安处电话：</td>
						<td>${community.securityPhone }</td>
					</tr>
					<tr>
						<td>物管处电话：</td>
						<td>${phone.phone }</td>
						<td></td>
					</tr>
				</table>


				<button class="com-2-1" onclick="queryCommunity();">修改</button>
				<button class="com-2-1" type="button"
					onclick="javascript:history.back(-1);">返回</button>

			</div>

		</div>
		<div class="modal fade" id="my" tabindex="-1" role="dialog"
			aria-labelledby="myModalLabel"
			style="width: 600px; height: 400px; background-color: #FFF; margin: auto; padding-top: 0px;">
			<div class="modal-header" id="log">
				<button type="button" class="close" data-dismiss="modal"
					aria-label="Close">
					<span aria-hidden="true">×</span>
				</button>
				<h4 class="modal-title" id="myModalLabel">编辑信息</h4>
				<form action="${initParam.url}/main/files" method="post"
					enctype="multipart/form-data">

					<table class="my-1">
						<tr>
							<td>安保处电话：</td>
							<td><input name="securityPhone" id="securityPhone"
								type="text" value="${community.securityPhone }"></td>
						</tr>
						<tr>
							<td>物管处电话：</td>
							<td><input name="phone" id="phone" type="text"
								value="${phone.phone }"></td>
						</tr>
						<tr>
							<td>小区LOGO：</td>
							<td><input name="file" type="file" class="file"></td>
						</tr>
						<tr>
							<td colspan="2"><input class="buy" type="submit" value="提交">
								<input type="button" value="取消"
								onclick="javascript:history.back(-1);"></td>
						</tr>
					</table>
					<table class="my-2">
						<tr>
							<td style="text-align: center;">预览：</td>
						</tr>
						<tr>
							<td>
								<img style="width: 150px; height: 160px;"
										onerror="this.src='${initParam.url}/statics/images/暂无图片.jpg'"
										src="" class="img">
									</td>
						</tr>
					</table>
				</form>
			</div>
		</div>
	</div>
</body>
</html>